package com.aspose.cells;

class zbkp extends zck {
   zbkp(zn var1, float var2, float var3, zbkr var4) {
      super(var1, var2, var3, var4);
      switch(this.e.b) {
      case 1:
      default:
         break;
      case 2:
         com.aspose.cells.b.a.b.a.zi var5 = new com.aspose.cells.b.a.b.a.zi(1.0F, 0.0F, 0.0F, -1.0F, 0.0F, this.e.S().i());
         this.a.b(var5);
         break;
      case 3:
         com.aspose.cells.b.a.b.a.zi var6 = new com.aspose.cells.b.a.b.a.zi(-1.0F, 0.0F, 0.0F, -1.0F, this.e.S().h(), this.e.S().i());
         this.a.b(var6);
         break;
      case 4:
         com.aspose.cells.b.a.b.a.zi var7 = new com.aspose.cells.b.a.b.a.zi(-1.0F, 0.0F, 0.0F, 1.0F, this.e.S().h(), 0.0F);
         this.a.b(var7);
      }

   }

   com.aspose.cells.b.a.b.a.ze a(com.aspose.cells.b.a.b.zq var1) {
      com.aspose.cells.b.a.b.a.ze var2 = new com.aspose.cells.b.a.b.a.ze();
      float var3 = 0.0F;
      float var4 = 0.0F;
      float var5 = 0.0F;
      float var6 = 0.0F;
      com.aspose.cells.b.a.b.zo[] var7 = new com.aspose.cells.b.a.b.zo[7];
      float var8 = 2.0F * Math.min(var1.h(), var1.i()) * 0.15F;
      if (this.e.m != null) {
         if (this.e.m.a.size() > 0) {
            var5 = com.aspose.cells.b.a.ze.a(this.e.m.a.get(0));
            var6 = com.aspose.cells.b.a.ze.a(this.e.m.a.get(1));
            var3 = var1.h() / 2.0F + var1.h() * Math.abs(com.aspose.cells.b.a.ze.a(this.e.m.a.get(0)) / 100000.0F);
            var4 = var1.i() / 2.0F + var1.i() * Math.abs(com.aspose.cells.b.a.ze.a(this.e.m.a.get(1)) / 100000.0F);
         } else {
            var5 = -20473.0F;
            var6 = 61957.0F;
            var3 = var1.h() / 2.0F + var1.h() * Math.abs(-0.20473F);
            var4 = var1.i() / 2.0F + var1.i() * Math.abs(0.61957F);
         }

         if (var3 <= var1.h() && var4 <= var1.i()) {
            com.aspose.cells.b.a.b.zt var9 = new com.aspose.cells.b.a.b.zt(var8, var8);
            com.aspose.cells.b.a.b.zq var10 = new com.aspose.cells.b.a.b.zq(var1.d(), var9);
            var2.a(var10, 180.0F, 90.0F);
            var10.a(var1.l() - var8);
            var2.a(var10, 270.0F, 90.0F);
            var10.b(var1.m() - var8);
            var2.a(var10, 0.0F, 90.0F);
            var10.a(var1.j());
            var2.a(var10, 90.0F, 90.0F);
            var2.i();
            return var2;
         }
      } else {
         var5 = -20473.0F;
         var6 = 61957.0F;
         var3 = var1.h() / 2.0F + var1.h() * Math.abs(-0.20473F);
         var4 = var1.i() / 2.0F + var1.i() * Math.abs(0.61957F);
      }

      float var15 = (float)(Math.atan((double)(var1.h() / var1.i())) * 180.0D / 3.141592653589793D);
      float var16 = 0.0F;
      if (var5 > 0.0F && var6 > 0.0F) {
         var16 = (float)(Math.atan((double)(var4 / var3)) * 180.0D / 3.141592653589793D);
      } else if (var5 < 0.0F && var6 > 0.0F) {
         var16 = 180.0F - (float)(Math.atan((double)(var4 / var3)) * 180.0D / 3.141592653589793D);
      } else if (var5 < 0.0F && var6 < 0.0F) {
         var16 = 180.0F + (float)(Math.atan((double)(var4 / var3)) * 180.0D / 3.141592653589793D);
      } else {
         var16 = 360.0F - (float)(Math.atan((double)(var4 / var3)) * 180.0D / 3.141592653589793D);
      }

      com.aspose.cells.b.a.b.zt var11;
      com.aspose.cells.b.a.b.zq var12;
      if (var16 > 0.0F && var16 < 90.0F - var15) {
         var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
         var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
         var7[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g() + var1.i() * 0.58F);
         var7[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g() + var4);
         var7[2] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h(), var1.g() + var1.i() * 0.83F);
         var2.a(var12, 180.0F, 90.0F);
         var12.a(var1.l() - var8);
         var2.a(var12, 270.0F, 90.0F);
         var2.a(var7[0], var7[1]);
         var2.a(var7[1], var7[2]);
         var12.b(var1.m() - var8);
         var2.a(var12, 0.0F, 90.0F);
         var12.a(var1.j());
         var2.a(var12, 90.0F, 90.0F);
      } else if (var16 > 90.0F - var15 && var16 < 90.0F) {
         var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
         var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
         var7[0] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h() * 0.83F, var1.g() + var1.i());
         var7[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g() + var4);
         var7[2] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h() * 0.58F, var1.g() + var1.i());
         var2.a(var12, 180.0F, 90.0F);
         var12.a(var1.l() - var8);
         var2.a(var12, 270.0F, 90.0F);
         var12.b(var1.m() - var8);
         var2.a(var12, 0.0F, 90.0F);
         var2.a(var7[0], var7[1]);
         var2.a(var7[1], var7[2]);
         var12.a(var1.j());
         var2.a(var12, 90.0F, 90.0F);
      } else if (var16 > 90.0F && var16 < 90.0F + var15) {
         if (var3 > var1.h()) {
            var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
            float var17 = var3 - var1.h();
            com.aspose.cells.b.a.b.zq var18 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
            var7[0] = new com.aspose.cells.b.a.b.zo(var17 + 0.42F * var1.h() + var1.f(), var1.i() + var1.g());
            var7[1] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
            var7[2] = new com.aspose.cells.b.a.b.zo(var17 + 0.17F * var1.h() + var1.f(), var1.i() + var1.g());
            var18.a(var18.f() + var17);
            var2.a(var18, 180.0F, 90.0F);
            var18.a(var1.l() - var8 + var17);
            var2.a(var18, 270.0F, 90.0F);
            var18.b(var1.m() - var8);
            var2.a(var18, 0.0F, 90.0F);
            var2.a(var7[0], var7[1]);
            var2.a(var7[1], var7[2]);
            var18.a(var1.j() + var17);
            var2.a(var18, 90.0F, 90.0F);
         } else {
            var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
            var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
            var7[0] = new com.aspose.cells.b.a.b.zo(0.42F * var1.h() + var1.f(), var1.i() + var1.g());
            var7[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h() - var3, var4 + var1.g());
            var7[2] = new com.aspose.cells.b.a.b.zo(0.17F * var1.h() + var1.f(), var1.i() + var1.g());
            var2.a(var12, 180.0F, 90.0F);
            var12.a(var1.l() - var8);
            var2.a(var12, 270.0F, 90.0F);
            var12.b(var1.m() - var8);
            var2.a(var12, 0.0F, 90.0F);
            var2.a(var7[0], var7[1]);
            var2.a(var7[1], var7[2]);
            var12.a(var1.j());
            var2.a(var12, 90.0F, 90.0F);
         }
      } else {
         float var13;
         if (var16 > 90.0F + var15 && var16 < 180.0F) {
            var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
            var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
            var13 = var3 - var1.h();
            var7[0] = new com.aspose.cells.b.a.b.zo(var13 + var1.f(), var1.i() * 0.83F + var1.g());
            var7[1] = new com.aspose.cells.b.a.b.zo(var1.f(), var4 + var1.g());
            var7[2] = new com.aspose.cells.b.a.b.zo(var13 + var1.f(), var1.i() * 0.58F + var1.g());
            var12.a(var12.f() + var13);
            var2.a(var12, 180.0F, 90.0F);
            var12.a(var1.l() - var8 + var13);
            var2.a(var12, 270.0F, 90.0F);
            var12.b(var1.m() - var8);
            var2.a(var12, 0.0F, 90.0F);
            var12.a(var1.j() + var13);
            var2.a(var12, 90.0F, 90.0F);
            var2.a(var7[0], var7[1]);
            var2.a(var7[1], var7[2]);
         } else {
            float var14;
            if (var16 > 180.0F && var16 < 180.0F + (90.0F - var15)) {
               if (var4 > var1.i()) {
                  var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
                  var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
                  var13 = var3 - var1.h();
                  var14 = var4 - var1.i();
                  var7[0] = new com.aspose.cells.b.a.b.zo(var13 + var1.f(), var1.i() * 0.42F + var14 + var1.g());
                  var7[1] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
                  var7[2] = new com.aspose.cells.b.a.b.zo(var13 + var1.f(), var1.i() * 0.17F + var14 + var1.g());
                  var12.a(var12.f() + var13);
                  var12.b(var12.g() + var14);
                  var2.a(var12, 180.0F, 90.0F);
                  var12.a(var1.l() - var8 + var13);
                  var2.a(var12, 270.0F, 90.0F);
                  var12.b(var1.m() - var8 + var14);
                  var2.a(var12, 0.0F, 90.0F);
                  var12.a(var1.j() + var13);
                  var2.a(var12, 90.0F, 90.0F);
                  var2.a(var7[0], var7[1]);
                  var2.a(var7[1], var7[2]);
               } else {
                  var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
                  var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
                  var13 = var3 - var1.h();
                  var7[0] = new com.aspose.cells.b.a.b.zo(var13 + var1.f(), var1.i() * 0.42F + var1.g());
                  var7[1] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.i() - var4 + var1.g());
                  var7[2] = new com.aspose.cells.b.a.b.zo(var13 + var1.f(), var1.i() * 0.17F + var1.g());
                  var12.a(var12.f() + var13);
                  var2.a(var12, 180.0F, 90.0F);
                  var12.a(var1.l() - var8 + var13);
                  var2.a(var12, 270.0F, 90.0F);
                  var12.b(var1.m() - var8);
                  var2.a(var12, 0.0F, 90.0F);
                  var12.a(var1.j() + var13);
                  var2.a(var12, 90.0F, 90.0F);
                  var2.a(var7[0], var7[1]);
                  var2.a(var7[1], var7[2]);
               }
            } else if (var16 > 180.0F + (90.0F - var15) && var16 < 270.0F) {
               if (var3 > var1.h()) {
                  var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
                  var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
                  var13 = var3 - var1.h();
                  var14 = var4 - var1.i();
                  var7[0] = new com.aspose.cells.b.a.b.zo(var13 + 0.17F * var1.h() + var1.f(), var14 + var1.g());
                  var7[1] = new com.aspose.cells.b.a.b.zo(var1.f(), var1.g());
                  var7[2] = new com.aspose.cells.b.a.b.zo(var13 + 0.42F * var1.h() + var1.f(), var14 + var1.g());
                  var12.a(var12.f() + var13);
                  var12.b(var12.g() + var14);
                  var2.a(var12, 180.0F, 90.0F);
                  var2.a(var7[0], var7[1]);
                  var2.a(var7[1], var7[2]);
                  var12.a(var1.l() - var8 + var13);
                  var2.a(var12, 270.0F, 90.0F);
                  var12.b(var1.m() - var8 + var14);
                  var2.a(var12, 0.0F, 90.0F);
                  var12.a(var1.j() + var13);
                  var2.a(var12, 90.0F, 90.0F);
               } else {
                  var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
                  var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
                  var13 = var4 - var1.i();
                  var7[0] = new com.aspose.cells.b.a.b.zo(var1.h() * 0.17F + var1.f(), var13 + var1.g());
                  var7[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var1.h() - var3, var1.g());
                  var7[2] = new com.aspose.cells.b.a.b.zo(0.42F * var1.h() + var1.f(), var13 + var1.g());
                  var12.b(var12.g() + var13);
                  var2.a(var12, 180.0F, 90.0F);
                  var2.a(var7[0], var7[1]);
                  var2.a(var7[1], var7[2]);
                  var12.a(var1.l() - var8);
                  var2.a(var12, 270.0F, 90.0F);
                  var12.b(var1.m() - var8 + var13);
                  var2.a(var12, 0.0F, 90.0F);
                  var12.a(var1.j());
                  var2.a(var12, 90.0F, 90.0F);
               }
            } else if (var16 > 270.0F && var16 < 270.0F + var15) {
               var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
               var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
               var13 = var4 - var1.i();
               var7[0] = new com.aspose.cells.b.a.b.zo(0.58F * var1.h() + var1.f(), var13 + var1.g());
               var7[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g());
               var7[2] = new com.aspose.cells.b.a.b.zo(0.83F * var1.h() + var1.f(), var13 + var1.g());
               var12.b(var12.g() + var13);
               var2.a(var12, 180.0F, 90.0F);
               var2.a(var7[0], var7[1]);
               var2.a(var7[1], var7[2]);
               var12.a(var1.l() - var8);
               var2.a(var12, 270.0F, 90.0F);
               var12.b(var1.m() - var8 + var13);
               var2.a(var12, 0.0F, 90.0F);
               var12.a(var1.j());
               var2.a(var12, 90.0F, 90.0F);
            } else if (var16 > 270.0F + var15 && var16 < 360.0F) {
               float var10000;
               if (var4 > var1.i()) {
                  var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
                  var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
                  var10000 = var3 - var1.h();
                  var14 = var4 - var1.i();
                  var7[0] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var14 + var1.i() * 0.17F + var1.g());
                  var7[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g());
                  var7[2] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), 0.42F * var1.i() + var14 + var1.g());
                  var12.b(var12.g() + var14);
                  var2.a(var12, 180.0F, 90.0F);
                  var12.a(var1.l() - var8);
                  var2.a(var12, 270.0F, 90.0F);
                  var2.a(var7[0], var7[1]);
                  var2.a(var7[1], var7[2]);
                  var12.b(var1.m() - var8 + var14);
                  var2.a(var12, 0.0F, 90.0F);
                  var12.a(var1.j());
                  var2.a(var12, 90.0F, 90.0F);
               } else {
                  var11 = new com.aspose.cells.b.a.b.zt(var8, var8);
                  var12 = new com.aspose.cells.b.a.b.zq(var1.d(), var11);
                  var10000 = var3 - var1.h();
                  var7[0] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), var1.i() * 0.17F + var1.g());
                  var7[1] = new com.aspose.cells.b.a.b.zo(var1.f() + var3, var1.g() + var1.i() - var4);
                  var7[2] = new com.aspose.cells.b.a.b.zo(var1.h() + var1.f(), 0.42F * var1.i() + var1.g());
                  var2.a(var12, 180.0F, 90.0F);
                  var12.a(var1.l() - var8);
                  var2.a(var12, 270.0F, 90.0F);
                  var2.a(var7[0], var7[1]);
                  var2.a(var7[1], var7[2]);
                  var12.b(var1.m() - var8);
                  var2.a(var12, 0.0F, 90.0F);
                  var12.a(var1.j());
                  var2.a(var12, 90.0F, 90.0F);
               }
            }
         }
      }

      var2.i();
      return var2;
   }

   void a() {
      float var1 = 0.0F;
      float var2 = 0.0F;
      float var3 = 0.0F;
      float var4 = 0.0F;
      if (this.e.m != null) {
         var3 = com.aspose.cells.b.a.ze.a(this.e.m.a.get(0));
         var4 = com.aspose.cells.b.a.ze.a(this.e.m.a.get(1));
         var1 = this.e.q() / 2.0F + this.e.q() * Math.abs(com.aspose.cells.b.a.ze.a(this.e.m.a.get(0)) / 100000.0F);
         var2 = this.e.r() / 2.0F + this.e.r() * Math.abs(com.aspose.cells.b.a.ze.a(this.e.m.a.get(1)) / 100000.0F);
      } else {
         var3 = -20473.0F;
         var4 = 61957.0F;
         var1 = this.e.q() / 2.0F + this.e.q() * Math.abs(-0.20473F);
         var2 = this.e.r() / 2.0F + this.e.r() * Math.abs(0.61957F);
      }

      float var5 = (float)(Math.atan((double)(this.e.q() / this.e.r())) * 180.0D / 3.141592653589793D);
      float var6 = 0.0F;
      if (var3 > 0.0F && var4 > 0.0F) {
         var6 = (float)(Math.atan((double)(var2 / var1)) * 180.0D / 3.141592653589793D);
      } else if (var3 < 0.0F && var4 > 0.0F) {
         var6 = 180.0F - (float)(Math.atan((double)(var2 / var1)) * 180.0D / 3.141592653589793D);
      } else if (var3 < 0.0F && var4 < 0.0F) {
         var6 = 180.0F + (float)(Math.atan((double)(var2 / var1)) * 180.0D / 3.141592653589793D);
      } else {
         var6 = 360.0F - (float)(Math.atan((double)(var2 / var1)) * 180.0D / 3.141592653589793D);
      }

      com.aspose.cells.b.a.b.zq var7 = new com.aspose.cells.b.a.b.zq();
      float var9;
      if (var6 > 0.0F && var6 < 90.0F - var5) {
         var7 = this.e.v();
      } else if (var6 > 90.0F - var5 && var6 < 90.0F) {
         var7 = this.e.v();
      } else {
         float var8;
         if (var6 > 90.0F && var6 < 90.0F + var5) {
            if (var1 > this.e.q()) {
               var8 = var1 - this.e.q();
               var7 = new com.aspose.cells.b.a.b.zq(this.e.s() + var8, this.e.t(), this.e.v().h(), this.e.v().i());
            } else {
               var7 = this.e.v();
            }
         } else if (var6 > 90.0F + var5 && var6 < 180.0F) {
            var8 = var1 - this.e.q();
            var7 = new com.aspose.cells.b.a.b.zq(this.e.s() + var8, this.e.t(), this.e.v().h(), this.e.v().i());
         } else if (var6 > 180.0F && var6 < 180.0F + (90.0F - var5)) {
            if (var2 > this.e.r()) {
               var8 = var1 - this.e.q();
               var9 = var2 - this.e.r();
               var7 = new com.aspose.cells.b.a.b.zq(this.e.s() + var8, this.e.t() + var9, this.e.v().h(), this.e.v().i());
            } else {
               var8 = var1 - this.e.q();
               var7 = new com.aspose.cells.b.a.b.zq(this.e.s() + var8, this.e.t(), this.e.v().h(), this.e.v().i());
            }
         } else if (var6 > 180.0F + (90.0F - var5) && var6 < 270.0F) {
            if (var1 > this.e.q()) {
               var8 = var1 - this.e.q();
               var9 = var2 - this.e.r();
               var7 = new com.aspose.cells.b.a.b.zq(this.e.s() + var8, this.e.t() + var9, this.e.v().h(), this.e.v().i());
            } else {
               var8 = var2 - this.e.r();
               var7 = new com.aspose.cells.b.a.b.zq(this.e.s(), this.e.t() + var8, this.e.v().h(), this.e.v().i());
            }
         } else if (var6 > 270.0F && var6 < 270.0F + var5) {
            var8 = var2 - this.e.r();
            var7 = new com.aspose.cells.b.a.b.zq(this.e.s(), this.e.t() + var8, this.e.v().h(), this.e.v().i());
         } else if (var6 > 270.0F + var5 && var6 < 360.0F) {
            float var10000;
            if (var2 > this.e.r()) {
               var10000 = var1 - this.e.q();
               var9 = var2 - this.e.r();
               var7 = new com.aspose.cells.b.a.b.zq(this.e.s(), this.e.t() + var9, this.e.v().h(), this.e.v().i());
            } else {
               var10000 = var1 - this.e.q();
               var7 = this.e.v();
            }
         }
      }

      if (!this.e.x().a()) {
         var7.a(-(this.e.x().f() / 2.0F), -(this.e.x().f() / 2.0F));
      }

      var9 = zbum.a(this.e.y());
      if (this.e.A() != 7 && this.e.A() != 9) {
         if (this.e.A() == 0 || this.e.A() == 8) {
            var7.c(var7.h() - var9);
         }
      } else {
         var7.a(var7.f() + var9);
      }

      if (!this.e.G().equals("\n")) {
         zbum.a(this.a, this.e, var7, this.e.G(), this.e.D(), this.e.y(), this.e.z(), this.e.A(), this.e.B(), this.e.C());
      }
   }
}
